--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: jpgraph and mysql passing array
am 24.03.2011 01:05:54 von David Robley
Chris Stinemetz wrote:
> Hello,
>
>
>
> I hope you can help me. The Jpgraph forum seems to be pretty
> uneventful with participation.
>
> I am trying to pass arrays through the image tag to populate my
> variables for my graph.
>
> I keep getting an error that there is no input. Do you have any
> suggestions?
>
> I would greatly appreciate it! I have been trying to figure this out
> for several hours.
>
> Below is my code:
>
> I need some help with finding a solution. For some reason my graph is
> not showing up when it evident that my arrays are being passed.
>
> When I use:
>
> echo "TEST DATA PRINT";
> print_r($datay,false);
>
> -------------------
>
> I keep getting the error:
>
> Empty input data array specified for plot.
>
> -----------------------
>
> My php script is as follows:
>
> -----------------------
>
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>
>
> KCRF Dashboard
>
> ini_set('display_errors', 1);
> error_reporting(E_ALL);
>
> $term=$_POST['term'];
> $term2=$_POST['term2'];
> $term3=$_POST['term3'];
>
> //include ('err_reporting.php');
> require ('PHP_Scripts/config.php');
> require_once ('jpgraph/jpgraph.php');
> require_once ('jpgraph/jpgraph_line.php');
>
> $sql = ("SELECT * FROM evdobanding WHERE Market like '%$term' and
> Cell_Sect = '$term2' and Date = '$term3' ORDER BY distance asc");
>
> $result = mysql_query($sql);
>
> while($row = mysql_fetch_array($result))
> {
> $datay[] = $row["MBusage"];
> $datax[] = $row["Distance"];
> }
>
> echo "TEST DATA PRINT";
>
> print_r($datay,false);
>
> ?>
> Thank you,
>
>
>
> Chris
If $datay shows as empty, my first step would be to check that your SQL
query doesn't return an empty set.
Cheers
--
David Robley
"This ocean is calm," said the sailors specifically.
Today is Pungenday, the 10th day of Discord in the YOLD 3177.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: jpgraph and mysql passing array
am 24.03.2011 10:41:07 von Simcha
On Wed, 23 Mar 2011 15:59:50 -0500
Chris Stinemetz wrote:
this line here, is not in php, and does not echo the php variables.
>
>
> // I think this is where I am having issues.
>
try instead
echo '';
?>
--
Simcha Younger
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: jpgraph and mysql passing array
am 27.03.2011 04:44:52 von Brian Smither
Would you try an experiment?
In this line:
$sql =3D ("SELECT * FROM evdobanding WHERE Market like '%$term' and=
Cell_Sect =3D '$term2' and Date =3D '$term3' ORDER BY distance asc");
Change to:
$sql =3D "SELECT * FROM evdobanding WHERE Market like '%".$term."' and=
Cell_Sect =3D '".$term2."' and Date =3D '".$term3."' ORDER BY distance=
asc";
That is, remove the parenthesis and concatenate the variables into the=
string.
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re: jpgraph and mysql passing array
am 27.03.2011 14:59:10 von Chris Stinemetz
On Sat, Mar 26, 2011 at 9:44 PM, Brian Smither wrote:
> Would you try an experiment?
Thanks for for the suggestion but this didn't seem to work. I beleive
it is a header conflict based on what I have researched.
I just can't seem to find a solution.
>
> In this line:
> $sql = ("SELECT * FROM evdobanding WHERE Market like '%$term' and Cell_Sect = '$term2' and Date = '$term3' ORDER BY distance asc");
>
> Change to:
> $sql = "SELECT * FROM evdobanding WHERE Market like '%".$term."' and Cell_Sect = '".$term2."' and Date = '".$term3."' ORDER BY distance asc";
>
> That is, remove the parenthesis and concatenate the variables into the string.
>
The code in the PHP block:
echo "TEST DATA PRINT";
print_r($datay,false);
is passing all the values from the sql query because I can see them on
the page with the jpgraph error.